package com.ybox.system.controller;

import com.ybox.common.core.web.controller.BaseController;
import com.ybox.common.core.web.domain.AjaxResult;
import com.ybox.system.domain.vo.IconVo;
import com.ybox.system.service.SysIconService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.TreeMap;

/**
 * @Author ych
 * @create 2023-2023/2/24-15:31
 */
@RestController
@RequestMapping("/icon")
public class SysIconController extends BaseController {

    private final SysIconService service;

    public SysIconController(SysIconService service) {
        this.service = service;
    }

    @GetMapping
    public AjaxResult getIcons(@RequestParam(value ="isFree",required=false) Integer isFree){
        TreeMap<String, List<IconVo>> map = service.selectAll(isFree);
        return success(map);
    }
}
